<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

include APPPATH.'third_party/class.JavaScriptPacker.php';

class Codecompression {

	protected $_compression_replace = array("\r","\n","\r\n","\t","    ");

	public function __construct(){}

	public function jscompression($code){
		$code = strval($code);
		$packer = new JavaScriptPacker($code, 'None', true, false);
		return $packer->pack();
	}

	public function csscompression($code){
		$code = strval($code);
		$code = str_replace($this->_compression_replace,'',$code);
		$code = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $code);
		return $code;
	}
}

/* End of file codecompression.php */
/* Location: ./application/libraries/codecompression.php */